<?php


namespace app\admin\controller\v1;


use app\common\controller\BaseController;
use app\common\model\Banner as BannerModel;
use app\common\model\BaseModel;


class Banner extends BaseController
{
    /**
     * 获取bannner列表
     * @return \think\response\Json
     */
    public function index()
    {
        $list = (new BannerModel())->getBannerList();
        return self::showResCode('获取成功',$list);
    }

    /**
     * 添加轮播图
     * @return \think\response\Json
     */
    public function save()
    {
        //验证参数
        $data = (new BannerModel())->Mcreate();
        return self::showResCode('添加成功',$data);
    }
}